<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    <title></title>

    <link href="lib/ionic/css/ionic.min.css" rel="stylesheet">
    <link href="css/ionic.css" rel="stylesheet">

    <!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
    <link href="css/ionic.app.css" rel="stylesheet">
    -->

    <!-- ionic/angularjs js -->
    <% HTML::script('lib/ionic/js/ionic.bundle.min.js') %>
    <% HTML::script('lib/ionic/js/angular/angular-resource.min.js') %>

    <!-- your app's js -->
    <script src="js/app.js"></script>
    <script src="js/controllers.js"></script>
    <script src="js/services.js"></script>
  </head>
  <body ng-app="wanhang" animation="slide-left-right-ios7">
    <!-- 
      The nav bar that will be updated as we navigate between views.
    -->
<!--    <ion-nav-bar class="bar-positive nav-title-slide-ios7">-->
<!--        <ion-nav-back-button class="button-icon icon  ion-ios7-arrow-back">-->
<!--            返回-->
<!--        </ion-nav-back-button>-->
<!--    </ion-nav-bar>-->
    <ion-nav-view></ion-nav-view>

    <script>
      angular.module("wanhang").constant("CSRF_TOKEN", "<% csrf_token() %>");
      var imgUrl = "http://wanhang.yzfreesom.com/img/headimg.jpeg";
      var lineLink = "http://wanhang.yzfreesom.com";
      var descContent = '万航实业有限公司创立于2005 年（前身是1996 年成立的万航汽配）。着眼于长远和可持续发展的理念，企业定位于做全球经济一体化背景下的汽配领域资源优化专家。';
      var shareTitle = '宁波万航实业有限公司';
      var appid = 'gh_542a1c43d5b7';
      function shareFriend() {
          WeixinJSBridge.invoke('sendAppMessage',{
              "appid": appid,
              "img_url": imgUrl,
              "img_width": "168",
              "img_height": "52",
              "link": lineLink,
              "desc": descContent,
              "title": shareTitle
          }, function(res) {
          })
      }
      function shareTimeline() {
          WeixinJSBridge.invoke('shareTimeline',{
              "img_url": imgUrl,
              "img_width": "200",
              "img_height": "200",
              "link": lineLink,
              "desc": descContent,
              "title": shareTitle
          }, function(res) {
          });
      }
      function shareWeibo() {
          WeixinJSBridge.invoke('shareWeibo',{
              "content": descContent,
              "url": lineLink
          }, function(res) {
          });
      }
      // 当微信内置浏览器完成内部初始化后会触发WeixinJSBridgeReady事件。
      document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
          // 发送给好友
          WeixinJSBridge.on('menu:share:appmessage', function(argv){
              shareFriend();
          });
          // 分享到朋友圈
          WeixinJSBridge.on('menu:share:timeline', function(argv){
              shareTimeline();
          });
          // 分享到微博
          WeixinJSBridge.on('menu:share:weibo', function(argv){
              shareWeibo();
          });
      }, false);
    </script>
  </body>
</html>
